﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>小米账号注册</title>
    <link rel="icon" href="~/img/logoregist.png" />
    <link rel="stylesheet" href="~/css/user.css" />
    <link rel="stylesheet" href="~/css/layui/css/layui.css" />
    <style>
        #huanguilogin{
           position:relative;
           top:-35px;
         color:red;
        }
        #imgtimg{
            width:20px;
            height:20px;

        }
    </style>
</head>
<body>
    <div id="header">

    </div>
    <div id="main">
       <img class="bg-video" src="~/img/tuzi.png" />
        @*<video class="bg-video" src="~/img/snow.mp4" autoplay loop muted></video>*@
    <div class="container">
        <div class="form-container">
           <span id="huanguilogin"> <a href="~/Home/Login" style="color:red;"><img id="imgtimg" src="~/img/timg.jfif"/>返回登录页</a></span> 
            <form id="form-register" class="layui-form">

                <div class="form-group">
                    <label for="uname">用户名:</label>
                    <input name="CustomerName" class="forminput" id="uname" minlength="3" maxlength="6" autofocus required type="text" />
                    <span class="bg-default help-block">长度在3~6位之间</span>
                </div>

                <div class="form-group">
                    <label for="upwd">密&nbsp;&nbsp;&nbsp;&nbsp;码:</label>
                    <input name="CustomerPassWord" class="forminput" id="upwd" type="password" minlength="6" autofocus required />
                    <span id="upwd-msg" class="bg-default help-block">密码长度在6~12位之间</span>
                </div>
                <div class="form-group">
                    <label for="phone">手机号码:</label>
                    <input name="CustomerPhone" class="forminput" id="phone" type="text" autofocus required />
                    <span id="phone-msg" class="bg-default help-block">请输入你的手机号码</span>
                </div>
                <div class="form-group">
                    <label for="email">邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</label>
                    <input name="CustomerEmail" class="forminput" id="email" type="text" autofocus />
                    <span id="email-msg" class="bg-default help-block">请输入合法邮箱格式</span>
                </div>
                <div class="form-group">
                    <label for="email">性&nbsp;&nbsp;&nbsp;&nbsp;别:</label>
                    <label class="lavle">男：</label> <input name="CustomerSex" id="nan" class="radionv" checked type="radio" value="男" autofocus />
                    <label class="lavle">女：</label> <input name="CustomerSex" id="nv" class="radionv" type="radio" value="女" autofocus />

                </div>

                @*<div class="form-group">
                    <label for="age">年&nbsp;&nbsp;&nbsp;&nbsp;龄:</label>
                    <input name="age" id="age" type="number" min="18" max="60" autofocus />
                    <span id="age-msg" class="bg-default help-block">年龄必须在18~60之间</span>
                </div>
                <div class="form-group">
                    <label for="birthday">生&nbsp;&nbsp;&nbsp;&nbsp;日:</label>
                    <input name="birthday" id="birthday" type="date" autofocus />
                    <span id="birthday-msg" class="bg-default help-block">请选择生日</span>
                </div>*@
                <div class="form-group btn-group">
                    <input class="btn btn-success" type="button" lay-submit lay-filter="login" id="btn-submit" value="提交信息">
                    <input class="btn btn-danger" type="reset" id="" value="清空输入">
                </div>
            </form>
        </div>
    </div>
    </div>
    <div id="footer">

    </div>
    <script src="~/js/jquery-1.8.3.min.js"></script>
    <script src="~/js/register.js"></script>
    <script src="~/css/layui/layui.js"></script>
    <script>
        layui.use(['form', 'layer'], function () {
            var layer = layui.layer,
                form = layui.form,
                $ = layui.$;
            form.on('submit(login)', function (data) {
                $.ajax({
                    url: "/Home/Register",
                    type: "post",
                    data: data.field,
                    success: function (res) {
                        if (res.success) {
                            layer.alert(res.message, { icon: 1 });
                        } else {
                            layer.msg(data.message);
                        }
                    }

                });

                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });

        });
    </script>
</body>
</html>
